package com.taobao.dao.impl;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import com.taobao.dao.CommonDao;
import com.taobao.dao.PreHistoryTaskDao;
import com.taobao.pojo.Config;
import com.taobao.pojo.HttpContext;

public class PreHistoryTaskDaoImpl extends CommonDao implements PreHistoryTaskDao {

	@Override
	public String[] preHistorySerach() throws Exception {
		return (String[]) getRequest(Config.url + "TasksHis_Search.aspx");
	}

	@Override
	public Object process(HttpContext context) throws Exception {
		String[] ve = null;
		Document doc = Jsoup.parse(context.getHtml());
		String vstr = doc.getElementById("__VIEWSTATE").attr("value");
		String estr = doc.getElementById("__EVENTVALIDATION").attr("value");

		ve = new String[2];
		ve[0] = vstr;
		ve[1] = estr;

		return ve;
	}

}
